<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>智能图书平台</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            font-family: 'Roboto', Arial, sans-serif;
            background: linear-gradient(135deg, #83a4d4, #b6fbff); /* 添加渐变背景 */
        }
        .container {
            width: 30%;
            background-color: #fff;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
            padding: 40px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        input[type="text"], input[type="password"] {
            width: 100%;
            margin-bottom: 20px;
            padding: 12px; /* 调整内边距 */
            border: 1px solid #e0e0e0;
            border-radius: 5px;
            font-size: 16px;
        }
        input[type="text"]:focus, input[type="password"]:focus { /* 增加输入框的焦点样式 */
            border-color: #3f51b5;
            outline: none;
        }
        button {
            padding: 10px 20px;
            margin: 5px;
            background-color: #3f51b5;
            color: #fff;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            transition: background-color 0.3s; /* 添加过渡效果 */
        }
        button:hover {
            background-color: #303f9f;
        }
        .button-container {
            display: flex;
            justify-content: space-between;
            width: 100%;
        }
    </style>
</head>
<body>
    <div class="container">
        {% if message == '用户登录失败请重新登录' or message == '管理员登录失败请重新登录' or message == '未注册用户' or message == '用户不存在请重新登录'%}
        <div id="message" hidden="true">{{message}}</div>
        {% endif %}
        <form method="post">
            <input type="text" name="username" id="username" placeholder="请输入用户名">
            <input type="password" name="password" id="password" placeholder="请输入密码">
            <div class="button-container">
                <button type="submit">登录</button>
                <button type="button" class="register-btn" onclick="window.location.href='/register'">注册</button>
            </div>
        </form>

        <script>
            const message = document.getElementById('message').innerHTML;
            alert(message);
        </script>

    </div>
</body>
</html>
